/*
* cec相关接口
*/

import base from "@/utils/global.params.js";
let Mock = require("mockjs");

// 导入cec数据mock模块

import market from "@/mock/tool/cec.market.js"
import chartsData from "@/mock/tool/cec.k-charts.js"
// 行情-拦截数据
Mock.mock(base.baseUrl + "/cec/marketlist", "post", (req, res) => {
    return {
        code: 200,
        msg: "行情中心数据加载完毕",
        data: market.marketList || [],
    };
});
// cec-自选-拦截数据
Mock.mock(base.baseUrl + "/cec/favorites", "post", (req, res) => {
    return {
        code: 200,
        msg: "自选数据加载完毕",
        data: market.marketList || [],
    };
});
// cec-指数-拦截数据
Mock.mock(base.baseUrl + "/cec/exponent", "post", (req, res) => {
    /* 价格指数 exponentPrice ； 
    *  USDT指数 exponentUSDT ；
    *  BTC指数 exponentBTC  ;
    *  请求参数类型中type进行区分,1,价格，2，usdt，3，btc
    */
    let param = JSON.parse(req.body).data.type;
    let data = {
        price: market.exponentPrice,
        usdt: market.exponentUSDT,
        btc: market.exponentBTC
    };
    return {
        code: 200,
        msg: "指数数据加载完毕",
        data: data,
    };
});
// k-charts-data-拦截数据
Mock.mock(base.baseUrl + "/cec/kline", "post", (req, res) => {
    return {
        code: 200,
        msg: "自选数据加载完毕",
        data: chartsData || [],
    };
});

